// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#ifndef EXTRUDESTACKEDATTRIBUTES_H
#define EXTRUDESTACKEDATTRIBUTES_H
#include <string>
#include <AttributeSubject.h>


// ****************************************************************************
// Class: ExtrudeStackedAttributes
//
// Purpose:
//    This class contains attributes for the extrude operator.
//
// Notes:      Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//
// ****************************************************************************

class ExtrudeStackedAttributes : public AttributeSubject
{
public:
    enum VariableDisplayType
    {
        NodeHeight,
        CellHeight,
        VariableIndex,
        OriginalData
    };

    // These constructors are for objects of this class
    ExtrudeStackedAttributes();
    ExtrudeStackedAttributes(const ExtrudeStackedAttributes &obj);
protected:
    // These constructors are for objects derived from this class
    ExtrudeStackedAttributes(private_tmfs_t tmfs);
    ExtrudeStackedAttributes(const ExtrudeStackedAttributes &obj, private_tmfs_t tmfs);
public:
    virtual ~ExtrudeStackedAttributes();

    virtual ExtrudeStackedAttributes& operator = (const ExtrudeStackedAttributes &obj);
    virtual bool operator == (const ExtrudeStackedAttributes &obj) const;
    virtual bool operator != (const ExtrudeStackedAttributes &obj) const;
private:
    void Init();
    void Copy(const ExtrudeStackedAttributes &obj);
public:

    virtual const std::string TypeName() const;
    virtual bool CopyAttributes(const AttributeGroup *);
    virtual AttributeSubject *CreateCompatible(const std::string &) const;
    virtual AttributeSubject *NewInstance(bool) const;

    // Property selection methods
    virtual void SelectAll();
    void SelectAxis();
    void SelectDefaultVariable();
    void SelectScalarVariableNames();
    void SelectVisualVariableNames();
    void SelectExtentMinima();
    void SelectExtentMaxima();
    void SelectExtentScale();

    // Property setting methods
    void SetAxis(const double *axis_);
    void SetByVariable(bool byVariable_);
    void SetDefaultVariable(const std::string &defaultVariable_);
    void SetScalarVariableNames(const stringVector &scalarVariableNames_);
    void SetVisualVariableNames(const stringVector &visualVariableNames_);
    void SetExtentMinima(const doubleVector &extentMinima_);
    void SetExtentMaxima(const doubleVector &extentMaxima_);
    void SetExtentScale(const doubleVector &extentScale_);
    void SetVariableDisplay(VariableDisplayType variableDisplay_);
    void SetLength(double length_);
    void SetSteps(int steps_);
    void SetPreserveOriginalCellNumbers(bool preserveOriginalCellNumbers_);

    // Property getting methods
    const double       *GetAxis() const;
          double       *GetAxis();
    bool               GetByVariable() const;
    const std::string  &GetDefaultVariable() const;
          std::string  &GetDefaultVariable();
    const stringVector &GetScalarVariableNames() const;
          stringVector &GetScalarVariableNames();
    const stringVector &GetVisualVariableNames() const;
          stringVector &GetVisualVariableNames();
    const doubleVector &GetExtentMinima() const;
          doubleVector &GetExtentMinima();
    const doubleVector &GetExtentMaxima() const;
          doubleVector &GetExtentMaxima();
    const doubleVector &GetExtentScale() const;
          doubleVector &GetExtentScale();
    VariableDisplayType GetVariableDisplay() const;
    double             GetLength() const;
    int                GetSteps() const;
    bool               GetPreserveOriginalCellNumbers() const;

    // Persistence methods
    virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
    virtual void SetFromNode(DataNode *node);

    // Enum conversion functions
    static std::string VariableDisplayType_ToString(VariableDisplayType);
    static bool VariableDisplayType_FromString(const std::string &, VariableDisplayType &);
protected:
    static std::string VariableDisplayType_ToString(int);
public:

    // Keyframing methods
    virtual std::string               GetFieldName(int index) const;
    virtual AttributeGroup::FieldType GetFieldType(int index) const;
    virtual std::string               GetFieldTypeName(int index) const;
    virtual bool                      FieldsEqual(int index, const AttributeGroup *rhs) const;

    // User-defined methods
    void addVariable(const std::string &variableName_);
    void InsertVariable(const std::string &variableName_, const int index = 0);
    void DeleteVariable(const std::string &variableName_, int minVariableCount);
    bool AttributesAreConsistent() const;

    // IDs that can be used to identify fields in case statements
    enum {
        ID_axis = 0,
        ID_byVariable,
        ID_defaultVariable,
        ID_scalarVariableNames,
        ID_visualVariableNames,
        ID_extentMinima,
        ID_extentMaxima,
        ID_extentScale,
        ID_variableDisplay,
        ID_length,
        ID_steps,
        ID_preserveOriginalCellNumbers,
        ID__LAST
    };

private:
    double       axis[3];
    bool         byVariable;
    std::string  defaultVariable;
    stringVector scalarVariableNames;
    stringVector visualVariableNames;
    doubleVector extentMinima;
    doubleVector extentMaxima;
    doubleVector extentScale;
    int          variableDisplay;
    double       length;
    int          steps;
    bool         preserveOriginalCellNumbers;

    // Static class format string for type map.
    static const char *TypeMapFormatString;
    static const private_tmfs_t TmfsStruct;
};
#define EXTRUDESTACKEDATTRIBUTES_TMFS "Dbss*s*d*d*d*idib"

#endif
